/**
 * testClusteringNoTopo.h
 * ubuntu8.10,g++4.3.2
 * 29/3/2009, CGCAD_THSS_THU_BJ_CH
 * Author : Xinlai Lu
 */

#include <qapplication.h>
#include "window.moc"
#include "glwidget.h"
#include "ucdinputfile.h"
#include "visKMeans.h"
#include "visKMedoids.h"
#include "visFlowTopology.h"

using namespace visualization;

//#define _DEBUG_
//#ifdef _DEBUG_
vector<unsigned int> *classHaveObj;
vector<Point> *streamlines;
unsigned int linesNum;
double c[3]; 
//#endif

class glW: public GLWidget
{
public:
	glW(QWidget *parent = 0) : GLWidget(parent),
														 forward(NULL), backward(NULL), 
														 fs(NULL), bs(NULL)
	{}
	~glW()
	{
		if(original == getDisplayType())
		{
			delete []forward;
			delete []backward;
			delete []fs;
			delete []bs;	
		}
	}

	GLuint makeObject();
  void set(double xn, double xx, double yn, double yx, double zn, double zx,
      		 double &sc, unsigned int kc, unsigned int iteration, vector<Point> *centers,
					 intgResults *fw, intgResults *bw, Point *fsrcs, Point *bsrcs
					)
	{
		xmin = xn;
		xmax = xx; 
		ymin = yn; 
		ymax = yx;
		zmin = zn;
		zmax = zx;
		scale = sc;
		k = kc; 
		itrt = iteration;
		clusterCenters = centers;
		forward = fw; 
		backward = bw; 
		fs = fsrcs; 
		bs = bsrcs;
	}

private:
  double xmin, xmax, ymin, ymax, zmin, zmax, scale;
  unsigned int k, itrt;
  // This variable may be spacial for each file.
  vector<Point> *clusterCenters;
	intgResults *forward, *backward;
	Point *fs, *bs;
	void drawTopo();
};
class win : public Window
{
public:
	win(glW *glwidget)
		: Window(glwidget)
	{}
	win(glW *glWOrigin, glW *glWUltimate, glW *glWCurrent, glW *glWNext)
		 : Window(glWOrigin, glWUltimate, glWCurrent, glWNext)
	{}
	~win(){}
};


